#import "MYShopCarVC.h"
#import "MYShopDetailsVC.h"
#import "IQKeyboardManager.h"
#import "MYDynamicDetailsGoodsCell.h"
#import "MYShopDetailsSpecificationsSelectView.h"
#import "MYShopDetailsExplainView.h"
#import "MYShopDetailsDistributionView.h"
#import "MYShopCarVC.h"
#import "MYShopSalesOrderVC.h"
#import "MYDynamicCommentVC.h"
#import "MYShopGoodsCommentVC.h"
#import "YQPCartListModel.h"
#import "MYImageBaseModel.h"
#define IMAGE_HEIGHT kYQPScreenWidth * (225/375.0)
#define NAVBAR_COLORCHANGE_POINT (IMAGE_HEIGHT - Height_NavBar*2)



@interface MYShopDetailsVC ()<MYDynamicDetailsGoodsCellDelegate>
@property (nonatomic, strong) UIButton * carBtn;
@property (nonatomic, strong) UIButton * sharedBtn;
@property (nonatomic, strong) MYShopDetailsBottonView * bottonView;
@property (nonatomic, assign) CGFloat webCellH;
@property (nonatomic, copy) NSMutableArray * IntroduceArr;
@property (nonatomic, strong) NSMutableArray * commentArr;

@property (nonatomic, strong) NSMutableArray * headImageArr;

/// 选择的商品销售属性
@property (strong, nonatomic) NSMutableArray *attrArr;

@property (strong, nonatomic) YQPGoodInfoModel *infoModel;

/// 选中的商品，单个---只有选中了有且只有一个商品，才可以进行下一步的收藏、加入购物车、立即购买操作
@property (strong, nonatomic) YQPSpuSaleAttrValueListModel *selectedModel;

@property (nonatomic, copy) NSString *checkAttr;

@property (nonatomic, assign) CGFloat goodsCellH;
@end

@implementation MYShopDetailsVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.webCellH = 50.0;
    [self _setupNavView];
    self.commentArr = [NSMutableArray array];
    self.headImageArr = [NSMutableArray array];
    self.attrArr = NSMutableArray.array;
    //原点（0，64）开始
    self.edgesForExtendedLayout = UIRectEdgeTop;
    self.view.backgroundColor = UIColor.whiteColor;
    [self wr_setNavBarBackgroundAlpha:0.0];
    self.navigationController.navigationBar.translucent = YES;
    
    [self getGoodInfoApi];
}

#pragma mark - 获取商品详情 
- (void)getGoodInfoApi
{
    NSString *url = [NSString stringWithFormat:@"%@%@",kGET_GOOD_INFO_URL,self.skuId];
    [YQPNetWorkingManager sendGetRequest:url parameters:@{} success:^(YQPNetWorkingBaseModel * _Nonnull responseObject) {
        self.infoModel = [YQPGoodInfoModel mj_objectWithKeyValues:responseObject.data];
        if (!self.selectedModel) {
            YQPSpuSaleAttrValueListModel * selectedModel = [YQPSpuSaleAttrValueListModel new];
            selectedModel.price = self.infoModel.skuInfo.price;
            selectedModel.ID = self.infoModel.skuInfo.ID;
            selectedModel.buyNumber = @"1";
            self.selectedModel = selectedModel;
        }
    } failure:^(NSUInteger statusCode, NSString * _Nonnull error) {
        YQUITIPSERROR(error);
    }];
}

-(void)setInfoModel:(YQPGoodInfoModel *)infoModel {
    _infoModel = infoModel;
    [self.headImageArr removeAllObjects];
    [self.commentArr removeAllObjects];
    if (self.infoModel.skuInfo.isCollection) {
        self.bottonView.likeBtn.selected = YES;
    }else{
        self.bottonView.likeBtn.selected = NO;
   }
    
    [self.commentArr addObjectsFromArray:self.infoModel.spuCommentList];
           
    for (int i = 0; i < self.infoModel.skuInfo.skuImageList.count; i++) {
        YQPSkuImageListModel *model = self.infoModel.skuInfo.skuImageList[i];
        [self.headImageArr addObject:model.imgUrl];
    }
    
    
    NSMutableArray *specificationsArr = [NSMutableArray array];
    for (YQPSpuSaleAttrListCheckBySkuModel *model in infoModel.spuSaleAttrListCheckBySku) {
        for (YQPSpuSaleAttrValueListModel *attrModel in model.spuSaleAttrValueList) {
                if (attrModel.isChecked) {
                    [specificationsArr addObject:attrModel.saleAttrValueName];
                }
        }
    }
    
    if (specificationsArr.count > 0) {
        NSString *specificationsStr = [NSString stringWithFormat:@"%@：%@",kYQLS(@"规格"),[specificationsArr componentsJoinedByString:@","]];
        [self.IntroduceArr replaceObjectAtIndex:0 withObject:specificationsStr];
    }
    
    [self.listTableView reloadData];
}

-(void)_setupNavView {
    [self.leftItem setImage:YQIMG(@"ShopDetails_back_icon") forState:(UIControlStateNormal)];
    UIView *rightView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 84, 30)];

    UIButton *carBtn = [UIButton buttonWithType:0];
    [carBtn setImage:YQIMG(@"ShopDetails_goodscar_icon") forState:(UIControlStateNormal)];
    carBtn.frame = CGRectMake(0, 0, 30, 30);
    self.carBtn = carBtn;
    ws(self);
    [self.carBtn addTapAction:^(id  _Nonnull sender) {
        MYShopCarVC *carVC = [[MYShopCarVC alloc] init];
        [weakself.navigationController pushViewController:carVC animated:true];
    }];
    [rightView addSubview:carBtn];
    
    UIButton *sharedBtn = [UIButton buttonWithType:0];
    sharedBtn.hidden = YES;
    [sharedBtn setImage:YQIMG(@"ShopDetails_shread_icon") forState:(UIControlStateNormal)];
    sharedBtn.frame = CGRectMake(54, 0, 30, 30);
    self.sharedBtn = sharedBtn;
    [rightView addSubview:self.sharedBtn];

    UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithCustomView:rightView];
    self.navigationItem.rightBarButtonItem = rightItem;
    
}
-(void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.translucent = YES;
    [[IQKeyboardManager sharedManager] setEnable:YES];
}

//保证进入下个界面nav正常显示
- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    self.navigationController.navigationBar.translucent = NO;
}

-(void)setupView {
    [super setupView];
    self.listTableView.backgroundColor = HexColor(0xFAFAFA);
    self.listTableView.frame = CGRectMake(0, 0, kYQPScreenWidth, kYQPScreenHeight-kHeight_Botton_SafeArea-49);
    [self.view addSubview:self.bottonView];
    [self.bottonView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(-kHeight_Botton_SafeArea);
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.height.mas_equalTo(49);
    }];
    kYQREGISTERTABLEVIEWCHeaderFooter([MYShopDetailsHeaderView class])
    kYQREGISTERTABLEVIEWCHeaderFooter([MYShopDetailsCommentHeaderView class])
    kYQREGISTERTABLEVIEWCHeaderFooter([MYShopDetailsTitleHeaderView class])
    
    kYQREGISTERTABLEVIEWNIBCELL(@"MYShopDetailsGoodsTitleCell")
    kYQREGISTERTABLEVIEWNIBCELL(@"MYShopDetailsIntroduceCell")
    kYQREGISTERTABLEVIEWNIBCELL(@"MYShopDetailsCommentCell")
    kYQREGISTERTABLEVIEWCELL([MYShopDetailsImageCell class])
    kYQREGISTERTABLEVIEWCELL([MYDynamicDetailsGoodsCell class])
    
}

#pragma mark - UITableViewDelegate, UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 5;
}

- (NSInteger)tableView:(nonnull UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    if(section == 1) {
        return self.IntroduceArr.count;
    }else if (section == 2) {
        return self.commentArr.count;
    }else if (section == 3) {
        return self.infoModel.imageList.count;
    }
    return 1;
}
- (nonnull UITableViewCell *)tableView:(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
    if (indexPath.section == 0) {
        MYShopDetailsGoodsTitleCell *titleCell = [tableView dequeueReusableCellWithIdentifier:@"MYShopDetailsGoodsTitleCell"];
        titleCell.priceLb.text = [NSString stringWithFormat:@"$%.2f",self.infoModel.skuInfo.price.doubleValue];
        titleCell.titleLb.text = self.infoModel.skuInfo.skuName;
        NSString *freiStr ;
        if (self.infoModel.skuInfo.freight.doubleValue <= 0.00) {
            freiStr =[NSString stringWithFormat:@"%@:%@",kYQLS(@"邮费"),kYQLS(@"免邮")];
        }else{
            freiStr =  [NSString stringWithFormat:@"%@:%.2f",kYQLS(@"邮费"),self.infoModel.skuInfo.freight.doubleValue];
        }
        titleCell.postageLb.text = freiStr;
        titleCell.salesLb.text = [NSString stringWithFormat:@"%@: %@",kYQLS(@"月销"),[self.infoModel.skuInfo.salesVolume removeStringSpace].length > 0 ? self.infoModel.skuInfo.salesVolume:@"0"];
        
        titleCell.placeLb.text = [NSString stringWithFormat:@"%@: %@",kYQLS(@"发货地点"),self.infoModel.skuInfo.deliveryPoint];//@":深圳市";
        //[titleCell setModel:self.model.skuInfo];
        return titleCell;
    }else if (indexPath.section == 1) {
        MYShopDetailsIntroduceCell *introduceCell = [tableView dequeueReusableCellWithIdentifier:@"MYShopDetailsIntroduceCell"];
        introduceCell.titleLb.text = self.IntroduceArr[indexPath.row];
        return introduceCell;
    }else if (indexPath.section == 2) {
        
        YQPSpuCommentListModel *model = self.commentArr[indexPath.row];
        
        MYShopDetailsCommentCell *commentCell = [tableView dequeueReusableCellWithIdentifier:@"MYShopDetailsCommentCell"];
        commentCell.userNameLb.text = model.userNikeName.length > 0 ?model.userNikeName:kYQLS(@"匿名");
        commentCell.timeLb.text = [YQPInsureValidate timeInStr:model.createTime];
        commentCell.colorLb.text = model.productAttribute;//[NSString stringWithFormat:@"%@: %@",kYQLS(@"颜色分类"),@"红色"];//@": 红色";
        commentCell.contentLb.text = model.content;
        [commentCell.userHeaerIcon sd_setImageWithURL:[NSURL URLWithString:model.userIcon] placeholderImage:IMAGE_NAMED(@"")];
        return commentCell;
    }else if (indexPath.section == 3) {
        MYImageBaseModel *imageModel = nil;
        if (indexPath.row < self.infoModel.imageList.count) {
            imageModel = self.infoModel.imageList[indexPath.row];
        }
        MYShopDetailsImageCell *imageCell = [tableView dequeueReusableCellWithIdentifier:@"MYShopDetailsImageCell"];
        [imageCell.detailsIamgeView setImageWithURL:[NSURL URLWithString:imageModel.url] placeholder:YQIMG(@"")];
        return imageCell;
    } else {
        MYDynamicDetailsGoodsCell *goodsCell = [tableView dequeueReusableCellWithIdentifier:@"MYDynamicDetailsGoodsCell"];

        goodsCell.collViewH = self.goodsCellH;
        goodsCell.delegate = self;
        goodsCell.goodArray = self.infoModel.relatedProductsList.copy;
        
        return goodsCell;
    }

}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.section == 0) {
        return 136;
    }else if (indexPath.section == 1) {
        return 43;
    }else if (indexPath.section == 2) {
//        return 117;
        YQPSpuCommentListModel *model = self.commentArr[indexPath.row];
        
        return [tableView fd_heightForCellWithIdentifier:@"MYShopDetailsCommentCell" configuration:^(MYShopDetailsCommentCell *commentCell) {
            commentCell.userNameLb.text = model.userNikeName.length > 0 ?model.userNikeName:kYQLS(@"匿名");
              commentCell.timeLb.text = [YQPInsureValidate timeInStr:model.createTime];
              commentCell.colorLb.text = model.productAttribute;//[NSString stringWithFormat:@"%@: %@",kYQLS(@"颜色分类"),@"红色"];//@": 红色";
              commentCell.contentLb.text = model.content;
              [commentCell.userHeaerIcon sd_setImageWithURL:[NSURL URLWithString:model.userIcon] placeholderImage:IMAGE_NAMED(@"")];
        }];
    }else if (indexPath.section == 3) {
        MYImageBaseModel *imageModel = nil;
        if (indexPath.row < self.infoModel.imageList.count) {
            imageModel = self.infoModel.imageList[indexPath.row];
        }
        
        CGFloat h = 0.0;
        if (imageModel.wide>0.0 && imageModel.high > 0.0) {
            h = imageModel.high * kYQPScreenWidth / imageModel.wide;
            return h;
        }

        return kYQPScreenWidth;
    }else{
        return self.goodsCellH;
    }
    return 44;
}
-(void)gotoSpecificationsSelectView {
    [MYShopDetailsSpecificationsSelectView showShopSearchScreenViewWithModel:self.infoModel.skuInfo andAttr:self.infoModel.spuSaleAttrListCheckBySku ResultBlack:^(YQPSpuSaleAttrValueListModel * _Nonnull selectedModel) {
        self.selectedModel = selectedModel;
    } updateGoodsInfoBlack:^(YQPGoodInfoModel * _Nonnull infoModel) {
        if (infoModel) {
            self.infoModel = infoModel;
        }
    } cancelBlack:^{
        
    }];

}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
    if (indexPath.section == 1) {
        if (indexPath.row == 0) {
            [self gotoSpecificationsSelectView];
        }
        if (indexPath.row == 1) {
            [MYShopDetailsDistributionView showShopDetailsExplainView];
        }
        if (indexPath.row == 2) {
            if (self.infoModel.skuInfo.quicknessRefund.intValue == 0 && self.infoModel.skuInfo.freightInsurance.intValue == 0 && self.infoModel.skuInfo.refundExplain.intValue == 0) {
                kMBMesHUD(kYQLS(@"暂无说明"));
                return;
            }
            [MYShopDetailsExplainView showShopDetailsExplainViewWithModel:self.infoModel.skuInfo];
        }
    }else if (indexPath.section == 3) {
        MYShopDetailsImageCell *imageCell = [tableView cellForRowAtIndexPath:indexPath];
        NSMutableArray *imaegUrlArr = [NSMutableArray array];
        for (MYImageBaseModel *imageModel in self.infoModel.imageList) {
            [imaegUrlArr addObject:imageModel.url];
        }
        YQBaseImageBrowserVC *imageBrowser = [[YQBaseImageBrowserVC alloc] initImageArrUrl:imaegUrlArr.copy currentIndex:indexPath.row sourceObject:imageCell];
        imageBrowser.currentPage = indexPath.row;
        [imageBrowser show];
    }
}

-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 10;
}

-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    if (section == 0) {
        MYShopDetailsHeaderView *header = [tableView dequeueReusableHeaderFooterViewWithIdentifier:@"MYShopDetailsHeaderView"];
        header.imageUrlStrArr = self.headImageArr;
        header.imgBannar.backgroundColor = kAPPThemeColor;
//        header.selectIndexAction = ^(NSInteger index) {
//            [self showBannarIndex:index];
//        };
        return header;
    }else if(section == 2){
        
        MYShopDetailsCommentHeaderView *headerView = [tableView dequeueReusableHeaderFooterViewWithIdentifier:@"MYShopDetailsCommentHeaderView"];
        headerView.titleLb.text = kYQLS(@"用户评价");
        headerView.countLb.text = [NSString stringWithFormat:@"%@(%lu)",kYQLS(@"好评"),(unsigned long)self.commentArr.count];//@"(39)";
        ws(self);
        [headerView.moreBtn addTapAction:^(id  _Nonnull sender) {
            MYShopGoodsCommentVC *commentVC = [[MYShopGoodsCommentVC alloc] init];
            commentVC.goodsID = self.infoModel.skuInfo.productId;
            [weakself.navigationController pushViewController:commentVC animated:true];
        }];
        return headerView;
    }else if(section == 3 || section == 4){
        MYShopDetailsTitleHeaderView *headerView = [tableView dequeueReusableHeaderFooterViewWithIdentifier:@"MYShopDetailsTitleHeaderView"];
        if (section == 3) {
            headerView.titleLb.text = kYQLS(@"商品详情");
        }else{
            headerView.titleLb.text = kYQLS(@"相似产品");
        }
        return headerView;
    }
    return nil;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    if (section == 0) {
        return kYQPScreenWidth * (225 / 375.0);
    }else if (section == 2) {
        return 84;
    }else if(section == 3 || section == 4){
        return 48;
    }
    return 0.001;
}

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    CGFloat offsetY = scrollView.contentOffset.y;
    
    if (offsetY > NAVBAR_COLORCHANGE_POINT)
    {
        CGFloat alpha = (offsetY - NAVBAR_COLORCHANGE_POINT) / Height_NavBar;
        [self.leftItem setImage:YQIMG(@"nav_back_sIcon") forState:(UIControlStateNormal)];
        [self wr_setNavBarBackgroundAlpha:alpha];
        [self wr_setNavBarTintColor:[[UIColor blackColor] colorWithAlphaComponent:alpha]];
        [self wr_setNavBarTitleColor:[[UIColor blackColor] colorWithAlphaComponent:alpha]];
        self.title = kYQLS(@"商品详情");
    }
    else
    {
        [self wr_setNavBarBackgroundAlpha:0];
        [self.leftItem setImage:YQIMG(@"ShopDetails_back_icon") forState:(UIControlStateNormal)];
        [self wr_setNavBarTintColor:[UIColor whiteColor]];
        [self wr_setNavBarTitleColor:[UIColor whiteColor]];
        self.title = @"";
    }
}
#pragma mark - UITableViewDelegate, UITableViewDataSource end
-(void)showBannarIndex:(NSInteger)index{
    
}
#pragma --makr lazy
-(MYShopDetailsBottonView *)bottonView {
    if (!_bottonView) {
        _bottonView = [MYShopDetailsBottonView viewFromXib];
        _bottonView.backgroundColor = UIColor.whiteColor;
        _bottonView.layer.shadowColor = HexColorA(0x000000, 0.6).CGColor;//RGB(70, 69, 69).CGColor;
        //2.设置阴影偏移范围
        _bottonView.layer.shadowOffset = CGSizeMake(0, 2);
        //3.设置阴影颜色的透明度
        _bottonView.layer.shadowOpacity = 0.5;
        
        //4.设置阴影半径
        _bottonView.layer.shadowRadius = 4;
        //5.设置阴影路径
        _bottonView.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.navigationController.navigationBar.bounds].CGPath;
        ws(self);
        
        [_bottonView.likeBtn addTapAction:^(id  _Nonnull sender) {
            if (!self.selectedModel) {
                [MBProgressHUD showMessage:kYQLS(@"请选择商品规格")];
                return ;
            }
            [weakself getLikeCollectionApi:sender];
        }];
        
        [_bottonView.buyBtn addTapAction:^(id  _Nonnull sender) {
            
            NSMutableArray *specificationsArr = [NSMutableArray array];
            for (YQPSpuSaleAttrListCheckBySkuModel *model in self.infoModel.spuSaleAttrListCheckBySku) {
                for (YQPSpuSaleAttrValueListModel *attrModel in model.spuSaleAttrValueList) {
                        if (attrModel.isChecked) {
                            [specificationsArr addObject:attrModel.saleAttrValueName];
                        }
                }
            }
            NSString *specificationsStr = @"";
            if (specificationsArr.count == self.infoModel.spuSaleAttrListCheckBySku.count) {
                specificationsStr = [specificationsArr componentsJoinedByString:@","];
                
            }
            
            if (!self.selectedModel) {
                return;
            }
            
            
            YQPCartModel *cartModel = [YQPCartModel new];
            cartModel.skuId = self.selectedModel.ID;
            cartModel.itemNumber = self.selectedModel.buyNumber;
            cartModel.skuImg = self.infoModel.skuInfo.skuDefaultImg;
            cartModel.specification = specificationsStr;
            cartModel.price = self.selectedModel.price;
            cartModel.skuName = self.infoModel.skuInfo.skuName;
            cartModel.freight = self.infoModel.skuInfo.freight;
            MYShopSalesOrderVC *orderVC = [[MYShopSalesOrderVC alloc] init];
            orderVC.selectGoodArray = @[cartModel];
            [weakself.navigationController pushViewController:orderVC animated:true];
        }];
        //加入购物车
        
        [_bottonView.addCar addTapAction:^(id  _Nonnull sender) {
            if (self.selectedModel) {
                [self addCartApi];
            }else{
                [self gotoSpecificationsSelectView];
            }
        }];
    }
    return _bottonView;
}

-(NSMutableArray *)IntroduceArr {
    if (!_IntroduceArr) {
        _IntroduceArr = [NSMutableArray arrayWithObjects:[NSString stringWithFormat:@"%@: %@",kYQLS(@"规格"),kYQLS(@"请选择")],kYQLS(@"其他销售渠道"),kYQLS(@"说明: 购买须知 商品说明"), nil];
    }
    return _IntroduceArr;
}

#pragma mark --收藏

/* toCollectIds (Array[integer], optional): 被收藏的ID-商品/帖子/资讯 ,
type (integer, optional): 收藏类型 ：1->商品收藏 2->帖子收藏 3->资讯收藏
*/
- (void)getLikeCollectionApi:(UIButton *)sender
{

    NSString *url = [NSString stringWithFormat:@"%@%@/%@",kPOST_ADD_USER_COLLECTIONS_URL,self.selectedModel.ID,@(1)];
    [YQPNetWorkingManager sendPostRequest:url parameters:@{} success:^(YQPNetWorkingBaseModel * _Nonnull responseObject) {
        if ([responseObject.data isEqualToString:@"1"]) {
             [MBProgressHUD showMessage:kYQLS(@"收藏成功")];
            self.bottonView.likeBtn.selected = YES;

        }else{
            [MBProgressHUD showMessage:kYQLS(@"取消收藏成功")];
            self.bottonView.likeBtn.selected = NO;

        }
    } failure:^(NSUInteger statusCode, NSString * _Nonnull error) {
        
    }];
}

#pragma mark - 加入购物车
- (void)addCartApi
{
    
    NSMutableDictionary *dic = NSMutableDictionary.new;
//    dic[@"cartItemId"] =//cartItemId (integer, optional): 购物车条目ID-修改数量时需要
    dic[@"skuId"] = self.selectedModel.ID;
    dic[@"skuNumber"] = self.selectedModel.buyNumber;
    YQSHOWLOADINGINVIEW
    [YQPNetWorkingManager sendPostRequest:kPOST_ADD_CART_URL parameters:dic success:^(YQPNetWorkingBaseModel * _Nonnull responseObject) {
        YQHIDELOADINGTIPS
        [MBProgressHUD showMessage:kYQLS(@"加入购物车成功")];
        //MYShopCarVC *cartvc = MYShopCarVC.new;
        //[self.navigationController pushViewController:cartvc animated:YES];
    } failure:^(NSUInteger statusCode, NSString * _Nonnull error) {
        YQHIDELOADINGTIPS
    }];
}

#pragma mark --MYDynamicDetailsGoodsCellDelegate
-(void)updateCollViewH:(CGFloat)h {
    self.goodsCellH = h;
    [self.listTableView reloadData];
}

- (void)didSelectItemAtItem:(NSInteger)item {
    YQPSkuModel *skuModel = self.infoModel.relatedProductsList[item];
    MYShopDetailsVC *detailsVC = [[MYShopDetailsVC alloc] init];
    detailsVC.skuId = skuModel.skuId;
    [self.navigationController pushViewController:detailsVC animated:true];
}
@end
